<?php

class base {

	protected $pagePath = '';
	protected $pluginPath = '';
	protected $flag = '';
	protected $wxShare = '';

	public function show($pageName, $pageExname = 'php') {
		require($this->pagePath . $pageName . '.' . $pageExname);
	}

	public function import($pluginName, $pluginExname = 'php') {
		require($this->pluginPath . $pluginName . '.' . $pluginExname);
	}

	public function setFlag($flag) {
		$this->flag = $flag;
	}

	public function load($pageName, $metaFlag, $fileVersion = '10.001', $pageTitle = _MANAGER_TITLE_) {
		echo '<!DOCTYPE html>';
		echo '<html>';
		echo '<head>';
		echo '<title>' . $pageTitle . '</title>';

		$this->setFlag($metaFlag);
		$this->import('meta');

		$cssPath = $this->pagePath . 'css/' . $pageName . '.css';
		$jsPath = $this->pagePath . 'js/' . $pageName . '.js';
		if (file_exists($cssPath)) {
			echo '<link rel="stylesheet" type="text/css" href="' . $cssPath . '?v=' . $fileVersion . '" />';
		}
		if (file_exists($jsPath)) {
			echo '<script type="text/javascript" src="' . $jsPath . '?v=' . $fileVersion . '"></script>';
		}

		echo '</head>';
		echo '<body>';
		echo '<div style="display: none;"></div>';
		echo '<div id="loadSpin" class="bg"></div>';
		echo '<div id="mainBg" class="bg" style="display: none;">';

		require($this->pagePath . $pageName . '.php');

		echo '</div>';
		echo '</body>';
		echo '</html>';
	}
	
}